package eSn.DB;

import java.sql.*; 

import eSn.DB.SQL.QuerySQL;
import eSn.DB.SQL.UpdateSQL;

public class eSnDB {
	private Connection cn ;
	private Statement st;
	public eSnDB(DBConf conf) throws SQLException{
		cn = DriverManager.getConnection("");
		st = cn.createStatement();
	}
	
	public ResultSet Query(String sql) throws SQLException {
		return st.executeQuery(sql);
	}
	
	public ResultSet Query(QuerySQL sql) throws SQLException{
		return Query(sql.toSQLString());
	}
	
	public void Update(String sql) throws SQLException {
		st.executeUpdate(sql);
	}
	public void Update(UpdateSQL sql) throws SQLException {
		Update(sql.toSQLString());
	}	
	
	public void Update(UpdateSQL[] sql) throws SQLException{
		for(int i =0;i < sql.length;i++){
			Update(sql[i].toSQLString());
		}
	}
	
}
